Document MCP custom content resources (mcpResources) and the harper+rest:// descriptor scheme#567
Document MCP custom content resources (mcpResources) and the harper+rest:// descriptor scheme#567kylebernhardy wants to merge 3 commits into
Conversation
…scheme (harper#1613) Companion to HarperFast/harper#1613 (fixes HarperFast/harper#1609): static mcpResources opt-in (fixed URIs + templates + completions + reserved-scheme rule), and exported-Resource descriptors moving from http(s):// to harper+rest:// with back-compat. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Code Review
This pull request updates the MCP tools and resources documentation to introduce the custom mcpResources opt-in feature, allowing component authors to expose arbitrary content under custom URIs. It also documents the transition from https:// to harper+rest:// URIs for application profile resources in version 5.1.16+ to align with the MCP specification. I have no feedback to provide as there are no review comments.
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-567 This preview will update automatically when you push new commits. |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
harper#1613 merged to v5.1 — version refs corrected to 5.1.18 (5.1.16/5.1.17 shipped before the merge). Unblocked whenever you're ready. Comment generated by an LLM (Claude Fable 5). |
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-567 This preview will update automatically when you push new commits. |
…ved, no login gate Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
🚀 Preview DeploymentYour preview deployment is ready! 🔗 Preview URL: https://preview.harper-documentation.harperfabric.com/pr-567 This preview will update automatically when you push new commits. |
|
|
||
| ### Custom `mcpResources` opt-in | ||
|
|
||
| A component author can expose arbitrary content — documentation pages, rendered reports, any `text` or `blob` payload — as MCP resources under author-chosen URIs by declaring a static `mcpResources` array (5.1.18+): |
There was a problem hiding this comment.
Could we use the repository's standard availability annotation here? Please add <VersionBadge version="v5.1.18" /> on its own line below the heading and remove (5.1.18+) from this sentence. That keeps this patch-level addition consistent with the neighboring v5.1 feature documentation.
| ]; | ||
|
|
||
| async readIndex() { | ||
| return { text: '- docs:///guides/install.md\n…', mimeType: 'text/markdown' }; |
There was a problem hiding this comment.
Our content style prefers plain ASCII when typography is not meaningful. Could this sample use ... instead of the Unicode ellipsis, and make the same replacement in the docs:///… example below? That also makes the copied examples easier to type and search.
| ### `harper+rest://` URIs | ||
|
|
||
| The application profile additionally exposes every exported `Resource` (that passes the `exportTypes.mcp` gate **and** the `hasRestVerbs` check) as an `https://<host>:<port>/<path>` URI. These resolve in-process via `Resources.getMatch(path, 'mcp')` — there is no outbound HTTP request. The body returned by `resources/read` is a small descriptor: | ||
| The application profile additionally exposes every exported `Resource` (that passes the `exportTypes.mcp` gate **and** the `hasRestVerbs` check) as a `harper+rest://<host>:<port>/<path>` URI (5.1.18+ — earlier releases listed these under `http(s)://`, which the MCP spec reserves for resources a client can fetch directly from the web; legacy `http(s)://` URIs continue to work for `resources/read` and `resources/subscribe`). These resolve in-process via `Resources.getMatch(path, 'mcp')` — there is no outbound HTTP request. The body returned by `resources/read` is a small descriptor: |
There was a problem hiding this comment.
Because this is a change to the existing descriptor URI behavior, please add <VersionBadge type="changed" version="v5.1.18" /> on its own line below the heading and remove the inline (5.1.18+) marker. This uses the repository's standard distinction between a newly added surface and changed behavior.
Companion docs for HarperFast/harper#1613 (fixes HarperFast/harper#1609).
Changes to
reference/mcp/tools-and-resources.mdmcpResourcesopt-in section (parallel to CustommcpTools): fixed URIs vsuriTemplate({name}/{+name}semantics), content return shapes (text/blob/JSON), live-class dispatch + RBAC delegation, per-parametercompletions, reserved-scheme rule, sanitized error behavior.https://URIs section →harper+rest://with the rationale (spec reserves https for web-fetchable resources) and the back-compat note for legacy URIs.Note for review
Version references say "5.1.16+" assuming harper#1613 ships in the next 5.1 patch — confirm at merge time. Hold merging until harper#1613 lands.
Generated by an LLM (Claude Fable 5).